<template>
  <h2>组合式api</h2>
  <div class="box">{{ title }}</div>
  <button @click="changeValue">修改title</button>
</template>

<script setup>
import { ref, nextTick } from "vue";

const title = ref('张三')

const changeValue = async () => {
  console.log('前：', document.querySelector('.box').textContent)
  title.value = '李四'
  await nextTick()
  console.log('后：', document.querySelector('.box').textContent)
}

</script>

<style scoped lang="scss"></style>
